<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>{% block title %}{% endblock %}</title>
        {% autoescape false %}
        {{ js('/js/jquery-1.7.1.min.js') }}
        {{ js('/js/knockout-2.1.0.js') }}
        {# js('/js/knockout.mapping-2.0.3.js') #}
        {{ js('/js/sammy-0.7.1.min.js') }}
        <!--[if lt IE 9]>
        {{ js('http://html5shim.googlecode.com/svn/trunk/html5.js') }}
        <![endif]-->
        {{ css('/css/admin/bootstrap/css/bootstrap.min.css') }}
        {{ css('/css/admin/admin.css') }}
        {% endautoescape %}
        <script type="text/javascript">
            $(function() {
                // Highlight current top menu item
                var urlController = location.href.match(/\/admin\/([^\/|#]+)/)
                if (urlController) {
                    $("#nav-menu li:has(a[rel=" + urlController[1] + "])").addClass("active");
                }
                
                $(".loadingIndicator").ajaxStart(function() {
                    $(this).show()
                }).ajaxComplete(function() {
                    $(this).hide()
                })
                
            });
        </script>         
        {% block head %}{% endblock %}
    </head>
    <body>
        <div id="nav-menu" class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="brand" href="/">Кто прав?</a>
                    {% if isAdmin %}
                    <ul class="nav">
                        <li><a rel="categories" href="/admin/categories">Рубрики</a></li>
                        <li><a rel="articles" href="/admin/articles">Статьи</a></li>
                        <li><a rel="banners" href="/admin/banners">Баннеры</a></li>
                    </ul>
                    {% endif %}
                    <ul class="nav pull-right">
                        {%  if not isAdmin %}
                        <li><a rel="login" href="/admin/login">Войти</a></li>
                        {% else %}
                        <li><a href="/admin/logout">Выйти</a></li>
                        {% endif %}
                    </ul>
                </div>
            </div>
        </div>
        <div class="container">
            <h2>{{ block('title') }}</h2>
            {% block body %}{% endblock %}
            <hr>
            <footer>
                <p>&copy; Кто-прав? 2011-2012</p>
            </footer>
        </div>
    </body>
</html>